<? if ($c = stack('name')) {
	

	$_table = 'CC_DOC_TEMPLATES';
	$_parent_key = 'classificatorvalue_id';

	$res = array();
//	dbdebug();

	if ($id = gccHuuid(param('document'))) {
		$_crit = "$_parent_key=$id";

		if ($d = datafetch_array('db_list', array('table' => $_table, 'select' => 'id, name, doc_template', 'where' => $_crit, 'index' => 'id'))) {
			$res = $d;
		}

	}

	header("Content-Type: application/json; charset=utf-8");
	print json_encode($res);

	exit;

}